package com.jx.enumType;

import java.util.HashSet;
import java.util.Set;

import com.jx.model.Dict;

/**
 * 
 * @author 姜旭
 * @version v1.11.20.2019
 * @since 
 * <p>创建时间：2019年11月24日
 * <p>功能描述：是否的枚举类
 * <p>官方网站：management/admin/index
 * <p>邮箱地址：524577360@qq.com
 */
public enum SwitchEnum {

	ON("on", "开"),
	OFF("off", "关");
	
	private String code;

	private String name;

	private SwitchEnum(String code, String name) {
		this.code = code;
		this.name = name;
	}

	/**
	 * 
	* @Title:getAllEnum
	* @Description:TODO(获取所有类型)
	* <p>邮箱地址: 524577360@qq.com
	* @return
	* Set<Dict>
	* @throws
	 */
	public static Set<Dict> getAllEnum(){
		Set<Dict> st=new HashSet<Dict>();
		for (SwitchEnum sde : SwitchEnum.values()) {
			Dict mp=new Dict();
			mp.setId(sde.getCode());
			mp.setText(sde.getName());
			st.add(mp);
		}
		return st;
	}

	/** <p>{@link String String getCode()*/
	public String getCode() {
		return code;
	}

	/** <p>setCode({@link String String code})*/
	public void setCode(String code) {
		this.code = code;
	}

	/** <p>{@link String String getName()*/
	public String getName() {
		return name;
	}

	/** <p>setName({@link String String name})*/
	public void setName(String name) {
		this.name = name;
	}

}
